from pydantic import BaseModel

# Shared properties
class ItemBase(BaseModel):
    title: str | None = None
    description: str | None = None
    is_active: bool = True

# Properties to receive on item creation
class ItemCreate(ItemBase):
    title: str

# Properties to receive on item update
class ItemUpdate(ItemBase):
    pass

# Properties shared by models stored in DB
class ItemInDBBase(ItemBase):
    id: int
    title: str

    class Config:
        from_attributes = True

# Properties to return to client
class Item(ItemInDBBase):
    pass
